import {Component, Input, OnInit} from '@angular/core';
import {StudentService} from "../student.service";
import {Student} from "../student";

@Component({
  selector: 'app-student-detail',
  templateUrl: './student-detail.component.html',
  styleUrls: ['./student-detail.component.css']
})
export class StudentDetailComponent implements OnInit {

  constructor(private studentService:StudentService) { }
  @Input()student:Student={
    id:-1,
    name:"请输入姓名",
    gender:"请输入性别",
    degree:"请输入学历",
    tel:"请输入手机号",
    addr:"请输入地址",
    born:"请输入生日"
  }

  ngOnInit() {
  }

  onSave(){
    this.studentService.save(this.student)
  }

}
